home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9437 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: web.cae.ca!usenet
  2. From: fraserh@cae.ca (Fraser Hutchinson)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Help on assignment
  5. Date: 1 Mar 1996 18:04:09 GMT
  6. Organization: CAE Electronics Ltd.
  7. Message-ID: <4h7e6p$qaf@web.cae.ca>
  8. References: <4gdmjm$1kr@cloner4.netcom.com> <312B94AA.5624@connix.com>
  9. NNTP-Posting-Host: pch63.cae.ca
  10. Mime-Version: 1.0
  11. Content-Type: Text/Plain; charset=US-ASCII
  12. X-Newsreader: WinVN 0.99.7
  13.  
  14.  
  15. In article <312B94AA.5624@connix.com>, shawley@connix.com says...
  16. >
  17. >I would do your home work but I will give a couple of hints.
  18. >
  19. >> Write a function that normally takes one argument, the address of a
  20. >> string, and prints that string once. However, if a second, type int
  21. >> argument is provided and is greater than zero, the function prints the
  22. >> string the number of times equal to the number of times indicated.
  23.  
  24. Normally, I would not do someone's homework, but I have to challenge this! :)
  25.  
  26.  
  27. >hint: int main(int argc, char **argv)
  28.  
  29. nope! Function! Not program!
  30.  
  31. try 
  32. void printme(char *string, int times = 1)
  33.  
  34.  
  35. >
  36. >> Second one is
  37. >> Write a function called zerosmaller that is passed to two int arguments
  38. >> by reference and then sets the smaller of the two numbers to 0. Write a
  39. >
  40. >hint: void set_smaller(int& val1, int& val2)
  41.  
  42. OK, you get an A for this :):):):)
  43.  
  44. Fraser
  45.  
  46.  
  47.